package com.interceptor;
//处理器类，耦合拦截器类
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyHandler implements InvocationHandler {
	
	private Object object;
	
	private Interceptor interceptor=new Interceptor();
	
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		
		Object result=null;		
		
		interceptor.before(); 
		result=method.invoke(object,args);
		interceptor.after();
		
		return result;
	}
	public void setObject(Object object) {
		this.object = object;
	}

}
